﻿using Sys.Core.Models.Dto;
using Sys.Core.Models.Queries;
using Sys.Core.Models.VO;
using Sys.Core.Services;
using MiniFox.Components;
using MiniFox.Infrastructure;

namespace Sys.Core
{
    /// <summary>
    /// 组织架构及关联部门
    /// </summary>
    [AutoRegister, SpareComponent(typeof(OrgService))]
    public interface IOrgService
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        ResultObject<IEnumerable<OrganizationVo>> Query(PagedQueryObject<OrgQuery> request);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="orgId"></param>
        /// <returns></returns>
        OrganizationVo Item(string orgId);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="organization"></param>
        /// <returns></returns>
        OrganizationVo Create(OrganizationDto organization);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="organization"></param>
        /// <returns></returns>
        OrganizationVo Update(OrganizationDto organization);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="orgs"></param>
        string Delete(string orgId);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="orgId"></param>
        /// <returns></returns>
        ITreeNode DeptTree(string orgId);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="dept"></param>
        /// <returns></returns>
        DeptVo CreateDept(DeptDto dept);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="dept"></param>
        /// <returns></returns>
        DeptVo UpdateDept(DeptDto dept);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="orgId"></param>
        /// <param name="deptId"></param>
        /// <returns></returns>
        string DeleteDept(string orgId, string deptId);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="deptPath"></param>
        /// <returns></returns>
        string DeleteDept(string deptPath);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="deptUserSet"></param>
        void AddUsers(DeptUserSet deptUserSet);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="deptUserSet"></param>
        void RemoveUsers(DeptUserSet deptUserSet);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="orgId"></param>
        /// <param name="deptId"></param>
        /// <param name="query"></param>
        /// <returns></returns>
        ResultObject<IEnumerable<UserVo>> GetUsers(string orgId, string deptId, PagedQueryObject<UserQuery> query);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="orgId"></param>
        /// <param name="deptId"></param>
        /// <param name="query"></param>
        /// <returns></returns>
        ResultObject<IEnumerable<UserVo>> ExclusionUsers(string orgId, string deptId, PagedQueryObject<UserQuery> query);
    }
}
